<?php
header ( 'content-type:text/html; charset=utf-8' );
session_start ();
@$yin=$_REQUEST['card'];
@$xing=$_REQUEST['xin'];
$su=strlen($yin);
$rmb=1000;
if ($su!=19){
	header('content-type:text/html; charset=utf-8');
	header('Refresh:3;url=/yu.php?caoid=5');
	echo "银行卡号不正确，请重新输入。";
}else {
	$pdo=new PDO('mysql:dbname=can;charset=utf8','root');
	$s=$pdo->prepare('insert into ka values(null,:card,:rmb,:xin)');
	if($s->execute(array('card'=>$yin,'rmb'=>$rmb,'xin'=>$xing))){
		header('content-type:text/html; charset=utf-8');
		header('Refresh:3;url=/yu.php');
		echo "添加成功";
	}else {
		header('content-type:text/html; charset=utf-8');
		header('Refresh:3;url=/yu.php?caoid=5');
		echo "error";
	}
}
?>